package com.generalbackend.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.generalbackend.common.model.entity.CommonConfig;
import com.generalbackend.common.model.query.CommonConfigQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* ClassName: CommonConfig
* @Description 公共配置表Mapper
* @author tim.xie
* @date 2021-11-18 13:31
*/

@Mapper
@Repository
public interface CommonConfigMapper extends BaseMapper<CommonConfig>{

    /**
    * 根据条件查询列表
    * @return
    */
    List<CommonConfig> list(Page<CommonConfig> page, @Param("commonConfigQuery") CommonConfigQuery commonConfigQuery);

    /**
     * 通过prefix和key修改value
     * @param prefix
     * @param key
     * @param value
     */
    void updateConfigValueByPrefixAndKey(@Param("prefix") String prefix,
                                         @Param("key") String key,
                                         @Param("value") String value);
}
